Fix formatting text after an Error in the Terminal#227
Open
MikeSullivan7 wants to merge 1 commit into
Open
Conversation
StephenNneji
approved these changes
May 14, 2026
Contributor
StephenNneji
left a comment
There was a problem hiding this comment.
Thanks for fixing this, I had no idea clicking the text somehow transferred the colour. I am curious if there is an option to switch off that behaviour but I could not find anything.
|
|
||
| def clear(self): | ||
| """Clear the text in the terminal.""" | ||
| self.write_html('<div style="color: black;white-space: pre-line;"><b>" "</b></div>') |
Contributor
There was a problem hiding this comment.
Hardcoding the black text colour may not be great for themes, it seems to work without the color entry i.e.
self.write_html('<div style="white-space: pre-line;"><b>" "</b></div>')
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fixes an issue in the Terminal where if an Error was produced via the Custom File and then the red text in the Termain was clicked (moving the invisible cursor), then all text in the Terminal will now be red, even if the Error is corrected.
To produce the issue in main:
All text in the Terminal will now be red.
This is fixed by when clearing the Terminal via
TerminalWidget.clear(), we move the cursor onto some black HTML text before clearing the text and resetting the colour of the text.Repeat the steps above on this branch to check that it fixes the formatting error.